/**
 * Created by JetBrains WebStorm.
 * User: Administrator
 * Date: 13-3-7
 * Time: 下午10:38
 * To change this template use File | Settings | File Templates.
 */
function styleHeaderSiblings(){
    if(!document.getElementsByTagName) return false;
    var headers = document.getElementsByTagName('h1');
    var elem;
    for(var i=0;i<headers.length;i++){
        elem = getNextElement(headers[i].nextSibling);
        elem.style.fontWeight = 'bold';
        elem.style.fontSize = '1.2em';
    }
}

function getNextElement(node){
    if(node.nodeType == 1){
        return node;
    }
    if(node.nextSibling){
        return getNextElement(node.nextSibling);
    }
    alert(2);
    return null;
}

addLoadEvent(styleHeaderSiblings);